package org.sfx.control

import javafx.collections.ObservableList
import javafx.scene.layout.Pane
import javafx.beans.property.ReadOnlyBooleanWrapper
import javafx.beans.property.ReadOnlyObjectWrapper
import javafx.beans.property.BooleanProperty
import javafx.beans.property.SimpleBooleanProperty
import javafx.beans.property.ObjectProperty
import javafx.scene.Node
import javafx.beans.property.SimpleObjectProperty

class Tab(val text: String) extends Pane {
  val selectedProperty: BooleanProperty = new SimpleBooleanProperty
  def selected: Boolean = selectedProperty.get
  def selected_=(value: Boolean) = selectedProperty.set(value)
  
  private val tabPanePropertyInternal: ReadOnlyObjectWrapper[TabPane] = new ReadOnlyObjectWrapper(this, "tabPane")
  def tabPaneProperty = tabPanePropertyInternal.getReadOnlyProperty
  def tabPane = tabPanePropertyInternal.get
  private[control] def tabPane_=(tabPane: TabPane) = tabPanePropertyInternal.set(tabPane)

  lazy val contentProperty: ObjectProperty[Node] = new SimpleObjectProperty(this, "content")
  def content = contentProperty.get
  def content_=(node: Node) = contentProperty.set(node)
}
